﻿<%@ Page Title="" Language="C#" MasterPageFile="~/account/account.master" AutoEventWireup="true" CodeFile="MyPurchases.aspx.cs" Inherits="account_MyPurchases" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 <style type="text/css">

.block{ color:red;
  display:inline-block;
}
.salesRecord
{
	border: 3px solid brown;
            padding: 0.5em 5px;
            margin-top: 1em;
	}

#placedate
{color: #0000FF;
 margin-right:15px
	
}
#prograss
{color: #0000FF;
 margin-right:15px;
	}
	
#GridView2
{
	margin-left:inherit;
}
     .style1
     {
         color: black;
         display: inline-block;
     }
     .style2
     {
         color: #0000FF;
     }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AccountContent" Runat="Server">
    <div><br />
        <br />
        <span class="style2">Uncompleted purchases：</span></div>
    <p>
        <asp:LinqDataSource ID="uncompletedSalesRecordSource" runat="server" 
            onselecting="uncompletedSalesRecordSource_Selecting">
        </asp:LinqDataSource>
        <asp:Repeater ID="Repeater1" runat="server" 
            DataSourceID="uncompletedSalesRecordSource" OnItemCommand="Repeater1_ItemCommand">
        <ItemTemplate>
            <section class="salesRecord">
                    <h3 class="placedDate">
                        Placed Date:<span id="placedate"><%# Eval("PlaceDate")%></span>Record Progress:<span id="prograss"><%# Eval("Prograss")%></span><asp:Button ID="Button1" runat="server" Text="Cancel" Visible='<%# Eval("Prograss").ToString()=="not accepted"?true:false %>' CommandName="delete" CommandArgument='<%#Eval("id") %>' ></asp:Button>
                     </h3>
                     <div class="gridViewCompleted">
                     <asp:GridView ID="GridView2" runat="server" DataSource='<%# Eval("SalesItems") %>' AutoGenerateColumns="False" >
                          <Columns>
                                <asp:BoundField DataField="ProductName" HeaderText="Name" 
                                SortExpression="quantity" />
                            <asp:BoundField DataField="quantity" HeaderText="Quantity" 
                                SortExpression="quantity" />
                          </Columns>
                     </asp:GridView>
                     </div>
            </section>
        </ItemTemplate>
        </asp:Repeater>
    </p>
    <br />
       <span class="style1"><br />
    <span class="style2">Completed purchases：</span><asp:LinqDataSource 
        ID="arrivedAndCompletedSource" runat="server" 
        onselecting="arrivedAndCompletedSource_Selecting">
    </asp:LinqDataSource>
    </span>
        


    &nbsp;<asp:Repeater ID="Repeater2" runat="server" 
        DataSourceID="arrivedAndCompletedSource" OnItemCommand="Repeater2_ItemCommand">
        <ItemTemplate>
            <section class="salesRecord">
                    <h3 class="placedDate">
                        Placed Date:<span id="placedate"><%# Eval("PlaceDate")%></span>Record Progress:<span id="prograss"><%# Eval("Prograss")%></span><asp:Button ID="Button2" runat="server" Text="Confirm" Visible='<%# Eval("Prograss").ToString()=="arrived     "?true:false %>' CommandName="confirm" CommandArgument='<%#Eval("id") %>'></asp:Button>
                     </h3>
                     <asp:GridView ID="GridView2" runat="server" DataSource='<%# Eval("SalesItems") %>' AutoGenerateColumns="False" >
                          <Columns>
                            <asp:BoundField DataField="ProductName" HeaderText="Name" 
                                SortExpression="quantity" />
                            <asp:BoundField DataField="quantity" HeaderText="Quantity" 
                                SortExpression="quantity" />

                          </Columns>
                          <EditRowStyle BorderStyle="None" />
                        <FooterStyle BorderStyle="None" />
                        <HeaderStyle BorderStyle="None" HorizontalAlign="Left" />
                     </asp:GridView>
            </section>
        </ItemTemplate>
    </asp:Repeater>
    &nbsp;<br />
                   


</asp:Content>

